﻿using System.ComponentModel.DataAnnotations;

namespace SampleWebApp.Models
{
    public class Person
    {
        [Required]
        [RegularExpression("^[A-Za-z\\-\\'\\.]{1,50}$", ErrorMessage = "First name invalid")]
        public string FirstName { get; set; }

        public string MiddleName { get; set; }

        [Required]
        [RegularExpression("^[A-Za-z\\-\\'\\.]{2,50}$", ErrorMessage = "Last name invalid")]
        public string LastName { get; set; }

        [EmailAddress]
        [Required]
        public string Email { get; set; }

        [Required]
        [MinLength(8)]
        public string Password { get; set; }

        [Compare("Password", ErrorMessage = "Password and confirmation do not match")]
        [Required]
        public string PasswordConfirmation { get; set; }

    }
}